<template>
	<!-- #ifdef MP-WEIXIN -->
	<view class="custom-navbar" :style="{paddingTop:distanceToTop+'px'}">
	<!-- #endif -->
		<!-- #ifdef APP-PLUS || H5 -->
		<view class="custom-navbar">
		<!-- #endif -->
			<view :class="'title u-flex-start,u-col-center'">分类</view>
			<view class="search">
				<view class="search-content u-flex" @click="$navigateTo('/subPackages/search/index')">
					<image class="images" :src="$getImageUrl('/user_client/static/icons/ss.png')"></image>
					<view class="search-text">请输入关键字进行搜索</view>
				</view>
			</view>
		</view>
</template>

<script>
	export default {
		data() {
			return {
				distanceToTop: 0,
				menuButtonWidth: 0,
				menuButtonHeight: 0
			}
		},
		props: {
			left: {
				type: Boolean, // 接收的参数类型
				default: true, //默认值
			},
			title: {
				type: String, // 接收的参数类型
				default: '', //默认值
			},
		},
		mounted() {
			// #ifdef MP-WEIXIN
			this.getMenuButtonPosition()
			// #endif 
		},
		methods: {
			getMenuButtonPosition() {
				const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
				this.menuButtonWidth = menuButtonInfo.width + 20
				this.distanceToTop = menuButtonInfo.top
				this.menuButtonHeight = menuButtonInfo.height
			}
		}
	}
</script>

<style lang="scss" scoped>
	.custom-navbar {
		width: 750rpx;
		position: sticky;
		top: 0;
		left: 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
		z-index: 99;
		background-color: #FFFFFF;
		// #ifdef APP-PLUS || H5
		padding-top: var(--status-bar-height);
		// #endif

		.title {
			text-align: center;
			font-size: 32rpx;
			color: $base-color;
		}

		.search {
			padding: 28rpx 28rpx 40rpx 28rpx;
			box-sizing: border-box;

			.search-content {
				padding: 18rpx 20rpx;
				box-sizing: border-box;
				background: #F3F3F3;

				.images {
					width: 28rpx;
					height: 26rpx;
					display: block;
				}

				.search-text {
					font-size: 28rpx;
					color: #CACACA;
					padding-left: 22rpx;
				}
			}
		}
	}
</style>